/******************************************************************************
//             INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in accordance with the terms of that agreement.
//        Copyright (c) 2000-2001 Intel Corporation. All Rights Reserved.
//
//  Description:
//      Intel(R) JPEG library for X platform 
//
********************************************************************************/
#include "_ijx.h"

/******************************************************************************
// Name:             ijAdd128_8x8_16s8u_C1
// Description:      Convert each input sample from a two's complement representation to
//                   an unsigned representation.
// Input Arguments: 
//             pSrc: Identifies source data in 8x8.
//          dstStep: Indicates the step of destination image.
// Output Arguments:
//             pDst: Identifies destination block;
//                  
// Remarks:      
//                   1. The start address of "pSrc" shall be aligned at 4byte boundary.
//                   2. It is better to do this alignement at 32byte boundary to optimize 
//                      D-Cache accessing.
//                   
// Returns:         
//    IPP_STATUS_OK: Succeeds.
//
******************************************************************************/
IppStatus __STDCALL ijAdd128_8x8_16s8u_C1(const Ipp16s *paSrc[],
                                          Ipp8u *pDst,
                                          int dstStep)
{
    return ippiLevelShiftAdd128_8x8_16s8u_C1(paSrc[0],pDst,dstStep);
}

/******************************************************************************
// Name:            ijTransformInv_MCU_16s_C1
// Description:     Generate grayscale image from huffman decoded coefficients.
// Input Arguments:
//            paSrc: Identifies a pointer array, each of which indicates each plane of source MCU blocks.
// Output Arguments:
//            paDst: Identifies a pointer array, each of which indicates each plane of destination MCU blocks.
//paDCTDequantTable: 
//                  Identifies a pointer array, each of which indicates a quanization table for each component.
// Remarks:      
//                  NONE.
//
// Returns:         
//                  NONE.
//
******************************************************************************/
void ijTransformInv_MCU_16s_C1 (const Ipp16s *paSrc[],
                                      Ipp16s *paDst[],
                                const Ipp32s *paDCTDequantTable[])
{
    ippiDCTQuantInv_JPEG_16s(paSrc[0], paDst[0], paDCTDequantTable[0]);
}

/******************************************************************************
// Name:            ijTransformInv444_MCU_16s_C3
// Description:     Generate grayscale image from huffman decoded coefficients.
// Input Arguments:
//            paSrc: Identifies a pointer array, each of which indicates each plane of source MCU blocks.
// Output Arguments:
//            paDst: Identifies a pointer array, each of which indicates each plane of destination MCU blocks.
//paDCTDequantTable: 
//                  Identifies a pointer array, each of which indicates a quanization table for each component.
// Remarks:      
//                  NONE.
//
// Returns:         
//                  NONE.
//
******************************************************************************/
void ijTransformInv444_MCU_16s_C3 (const Ipp16s *paSrc[],
                                         Ipp16s *paDst[],
                                   const Ipp32s *paDCTDequantTable[])
{
    ippiDCTQuantInv_JPEG_16s(paSrc[0], paDst[0], paDCTDequantTable[0]);
    ippiDCTQuantInv_JPEG_16s(paSrc[1], paDst[1], paDCTDequantTable[1]);
    ippiDCTQuantInv_JPEG_16s(paSrc[2], paDst[2], paDCTDequantTable[2]);
}

/******************************************************************************
// Name:            ijTransformInv422_MCU_16s_C3
// Description:     Generate grayscale image from huffman decoded coefficients.
// Input Arguments:
//            paSrc: Identifies a pointer array, each of which indicates each plane of source MCU blocks.
// Output Arguments:
//            paDst: Identifies a pointer array, each of which indicates each plane of destination MCU blocks.
//paDCTDequantTable: 
//                  Identifies a pointer array, each of which indicates a quanization table for each component.
// Remarks:      
//                  NONE.
//
// Returns:         
//                  NONE.
//
******************************************************************************/
void ijTransformInv422_MCU_16s_C3 (const Ipp16s *paSrc[],
                                         Ipp16s *paDst[],
                                   const Ipp32s *paDCTDequantTable[])
{
    ippiDCTQuantInv_Blocks_JPEG_16s(paSrc[0], paDst[0], 2, paDCTDequantTable[0]);
/*
    ippiDCTQuantInv_JPEG_16s(paSrc[0], paDst[0], paDCTDequantTable[0]);
    ippiDCTQuantInv_JPEG_16s(&paSrc[0][64], &paDst[0][64], paDCTDequantTable[0]);
*/
    ippiDCTQuantInv_JPEG_16s(paSrc[1], paDst[1], paDCTDequantTable[1]);
    ippiDCTQuantInv_JPEG_16s(paSrc[2], paDst[2], paDCTDequantTable[2]);
}

/******************************************************************************
// Name:            ijTransformInv411_MCU_16s_C3
// Description:     Generate grayscale image from huffman decoded coefficients.
// Input Arguments:
//            paSrc: Identifies a pointer array, each of which indicates each plane of source MCU blocks.
// Output Arguments:
//            paDst: Identifies a pointer array, each of which indicates each plane of destination MCU blocks.
//paDCTDequantTable: 
//                  Identifies a pointer array, each of which indicates a quanization table for each component.
// Remarks:      
//                  NONE.
//
// Returns:         
//                  NONE.
//
******************************************************************************/
void ijTransformInv411_MCU_16s_C3 (const Ipp16s *paSrc[],
                                         Ipp16s *paDst[],
                                   const Ipp32s *paDCTDequantTable[])
{
    ippiDCTQuantInv_Blocks_JPEG_16s(paSrc[0], paDst[0], 4, paDCTDequantTable[0]);
/*
    ippiDCTQuantInv_JPEG_16s(paSrc[0], paDst[0], paDCTDequantTable[0]);
    ippiDCTQuantInv_JPEG_16s(&paSrc[0][64], &paDst[0][64], paDCTDequantTable[0]);
    ippiDCTQuantInv_JPEG_16s(&paSrc[0][128], &paDst[0][128], paDCTDequantTable[0]);
    ippiDCTQuantInv_JPEG_16s(&paSrc[0][192], &paDst[0][192], paDCTDequantTable[0]);
*/
    ippiDCTQuantInv_JPEG_16s(paSrc[1], paDst[1], paDCTDequantTable[1]);
    ippiDCTQuantInv_JPEG_16s(paSrc[2], paDst[2], paDCTDequantTable[2]);
}

/* EOF */
